package com.suray.type;

/**
 * 地图地码方向
 */
public enum RgvMapTagDirection {
    INVALID(-1, "无效"),
    RIGHT(0, "右"),
    LEFT(180, "左"),
    UP(90, "上"),
    DOWN(270, "下"),
    ;

    int value;
    String des;

    RgvMapTagDirection(int value, String des) {
        this.value = value;
        this.des = des;
    }

    public int getValue() {
        return value;
    }

    public static RgvMapTagDirection parseDirection(int value) {
        for (RgvMapTagDirection rgvMapTagDirection : RgvMapTagDirection.values()) {
            if (rgvMapTagDirection.value == value) {
                return rgvMapTagDirection;
            }
        }

        return INVALID;
    }

    @Override
    public String toString() {
        return des;
    }
}
